﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Whir_System_Module_Template_SetSlide : System.Web.UI.Page
{
    protected char isPostBack;    //是否第一次访问

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            this.isPostBack = '0';
        else
            this.isPostBack = '1';
    }

    //绑定表单
    protected void btnF_Click(object sender, EventArgs e)
    {
        //绑定并选择表单
        this.fs1.BindDropF();

        DropDownList ddl = this.fs1.FindControl("ddlForm") as DropDownList;

        for (int i = 0; i < ddl.Items.Count; i++)
        {
            string v = ddl.Items[i].Value;
            if (v != "-1")
            {
                if (v.Split('_')[0] == this.hfFormID.Value)
                {
                    ddl.Items[i].Selected = true;
                    break;
                }
            }
        }
        //end

        //绑定并选择字段
        this.fs1.BindCbl();

        if (this.hfSelect.Value != "*")
        {
            string select = "," + this.hfSelect.Value + ",";
            CheckBoxList cbl = this.fs1.FindControl("cblField") as CheckBoxList;

            for (int i = 0; i < cbl.Items.Count; i++)
            {
                string v = "," + cbl.Items[i].Text + ",";
                if (select.IndexOf(v) == -1)
                    cbl.Items[i].Selected = false;
            }
        }
    }
}
